#! /bin/bash

# 安装docker
# sudo wget -qO- https://get.docker.com/ | sh

sudo apt-get install -y docker docker-compose

# 设置阿里云为默认的docker仓库
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://bbcofja0.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl start docker

sudo service docker start 

# 安装 docker-compose
# HOST=http://update.gonsincloud.com/jenkins
# sudo curl -L ${HOST}/docker-compose -o /usr/bin/docker-compose
# sudo chmod +x /usr/bin/docker-compose



## 安装portainer
# sudo docker pull docker.io/portainer/portainer
sudo docker pull registry.cn-shenzhen.aliyuncs.com/gonsinrd/portainer
sudo docker volume create portainer_data
sudo docker run -d -p 9000:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data --name portainer registry.cn-shenzhen.aliyuncs.com/gonsinrd/portainer


